/*!
\copyright  Copyright (c) 2023 Qualcomm Technologies International, Ltd.\n
            All Rights Reserved.\n
            Qualcomm Technologies International, Ltd. Confidential and Proprietary.
\file       
\brief      Events sent by the HFP profile
*/

#ifndef HFP_PROFILE_CHANNEL_EVENT_SPEC_H_
#define HFP_PROFILE_CHANNEL_EVENT_SPEC_H_

#include "channel_event_spec_ids.h"
#include <bdaddr.h>

/*! @{ */

/*! \brief The HFP profile event channel */
#define EVENT_BUS_CHANNEL_HFP_PROFILE     hfp_profile_event_channel

/*! \brief The HFP profile call state. */
typedef enum
{
    hfp_profile_event_call_inactive,
    hfp_profile_event_call_active,
} hfp_profile_event_call_t;

/*! \brief The HFP profile call setup state. */
typedef enum
{
    hfp_profile_event_call_setup_none,
    hfp_profile_event_call_setup_incoming,
    hfp_profile_event_call_setup_outgoing,
    hfp_profile_event_call_setup_alerting,
} hfp_profile_event_call_setup_t;

/*! \brief The HFP profile call held state. */
typedef enum
{
    hfp_profile_event_call_held_inactive,
    hfp_profile_event_call_held_active,
    hfp_profile_event_call_held_no_active,
} hfp_profile_event_call_held_t;

/*! \brief The HFP profile disconnect reasons */
typedef enum
{
    hfp_profile_disconnect_normal,
    hfp_profile_disconnect_linkloss,
    hfp_profile_disconnect_error,
} hfp_profile_disconnect_reason_t;

/*! \brief The HFP profile events that are sent. */
typedef enum
{
    hfp_profile_event_connected,
    hfp_profile_event_disconnected,
    hfp_profile_event_audio_connected,
    hfp_profile_event_audio_disconnected,
    hfp_profile_event_callsetup_ind,
    hfp_profile_event_call_ind,
    hfp_profile_event_callheld_ind,
    hfp_profile_event_ring_ind,
    hfp_profile_event_speaker_gain_ind,
    hfp_profile_event_mic_gain_ind,
    hfp_profile_event_inband_ring_ind,
    hfp_profile_event_voice_recognition_ind,
    hfp_profile_event_at_command_complete,
    hfp_profile_event_absolute_volume_change,
    hfp_profile_event_unknown_at_command_received,
} hfp_profile_event_t;
 
/*! \brief The data sent with the hfp_profile_event_connected event. */
typedef struct
{
    bdaddr addr;
    uint32 supported_features;
    hfp_profile_event_call_setup_t call_setup;
    hfp_profile_event_call_t call;
    hfp_profile_event_call_held_t call_held;
    uint8 volume;
} hfp_profile_event_connected_t;

/*! \brief The data sent with the hfp_profile_event_disconnected event. */
typedef struct
{
    bdaddr addr;
    hfp_profile_disconnect_reason_t reason;
} hfp_profile_event_disconnected_t;

/*! \brief The data sent with the hfp_profile_event_audio_connected event. */
typedef struct
{
    bdaddr addr;
} hfp_profile_event_audio_connected_t;

/*! \brief The data sent with the hfp_profile_event_audio_disconnected event. */
typedef struct
{
    bdaddr addr;
    uint16 reason;
} hfp_profile_event_audio_disconnected_t;

/*! \brief The data sent with the hfp_profile_event_callsetup event. */
typedef struct
{
    bdaddr addr;
    hfp_profile_event_call_setup_t call_setup;
} hfp_profile_event_callsetup_ind_t;

/*! \brief The data sent with the hfp_profile_event_call event. */
typedef struct
{
    bdaddr addr;
    hfp_profile_event_call_t call;
} hfp_profile_event_call_ind_t;

/*! \brief The data sent with the hfp_profile_event_callheld event. */
typedef struct
{
    bdaddr addr;
    hfp_profile_event_call_held_t call_held;
} hfp_profile_event_callheld_ind_t;

/*! \brief The data sent with the hfp_profile_event_ring_ind event. */
typedef struct
{
    bdaddr addr;
} hfp_profile_event_ring_ind_t;

/*! \brief The data sent with the hfp_profile_event_speaker_gain_ind event. */
typedef struct
{
    bdaddr addr;
    uint8 gain;
} hfp_profile_event_speaker_gain_ind_t;

/*! \brief The data sent with the hfp_profile_event_mic_gain_ind event. */
typedef struct
{
    bdaddr addr;
    uint8 gain;
} hfp_profile_event_mic_gain_ind_t;

/*! \brief The data sent with the hfp_profile_event_inband_ring_ind event. */
typedef struct
{
    bdaddr addr;
    bool enable;
} hfp_profile_event_inband_ring_ind_t;

/*! \brief The data sent with the hfp_profile_event_voice_recognition_ind event. */
typedef struct
{
    bdaddr addr;
    bool enable;
} hfp_profile_event_voice_recognition_ind_t;

/*! \brief The data sent with the hfp_profile_event_at_command_complete event. */
typedef struct
{
    bdaddr addr;
    bool success;
} hfp_profile_event_at_command_complete_t;

/*! \brief The data sent with the hfp_profile_event_absolute_volume_change event. */
typedef struct
{
    bdaddr addr;
    uint8 volume;
    event_origin_t origin;
} hfp_profile_event_absolute_volume_change_t;

/*! \brief The data sent with the hfp_profile_event_unknown_at_command_received event. */
typedef struct
{
    bdaddr addr;
    uint16 data_size;
    uint8  *data;
} hfp_profile_event_unknown_at_command_received_t;

/*! @} */

#endif /* HFP_PROFILE_CHANNEL_EVENT_SPEC_H_ */
